package com.cooge.xxmp.util;

import java.io.UnsupportedEncodingException;

import javax.servlet.http.HttpServletRequest;

public class NetUtil {
	
	public static String requestToString(HttpServletRequest request,String name){
		
		String username = null;
		try {
			username = new String (request.getParameter(name).getBytes("iso-8859-1"),"UTF-8");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		if(username==null){
			username = (String) request.getAttribute(name);
		}
		return username;
	}
	

}
